<template>
  <div class="app">
    <van-nav-bar
      :title="title"
      left-text="返回"
      left-arrow
      @click-left="onClickLeft"
      fixed
    />
    <router-view></router-view>
    <van-tabbar v-model="active">
      <van-tabbar-item icon="home-o" to="/home">主页</van-tabbar-item>
      <van-tabbar-item icon="search" to="/found">发现</van-tabbar-item>
      <van-tabbar-item icon="friends-o" to="/login">登录</van-tabbar-item>
      <van-tabbar-item icon="setting-o" to="/install">设置</van-tabbar-item>
    </van-tabbar>
  </div>
</template>

<script>
export default {
  data() {
    return {
      title: this.$route.meta.title,
      active: 0
    }
  },
  created() {
  },
  methods: {
    onClickLeft() { }
  },
  watch: {
    '$route.meta.title'(newVal) {
      this.title = newVal
    }
  }
}
</script>

<style>
.app {
  padding-top: 46px;
  padding-bottom: 50px;
}
</style>